import 'dart:convert';

import 'package:flutter/services.dart';
import 'package:hy/modules/home/models/home_list_model.dart';

class HomeListWidgetModel {
  /// 获取数据
  static Future<List<HomeListElementResponseModel>> initializeData() async {
    String jsonData =
        await rootBundle.loadString('assets/configs/list_data.json');
    List<dynamic> datas = json.decode(jsonData);

    List<HomeListElementResponseModel> dataModels =
        datas.map((e) => HomeListElementResponseModel.fromJson(e)).toList();
    print("models---: $dataModels");

    return dataModels;
  }
}
